const db = require('dmdb')

db.createPool({
  // connectString: 'jdbc:dm://192.168.2.115:5236?clobAsString=true',
  // connectString: 'dm://192.168.2.115:5236',
  connectionString:
    'dm://BIG-SCREEN:123456@192.168.2.115:5236?clobAsString=true',
  poolMin: 1,
  poolMax: 3,
  // poolAlias: 'DM5236'
  poolAlias: 'd5454'
})
  .then(function (pool) {
    // console.log('lanshangle ', pool)
    pool.getConnection().then(conn => {
      var sql = 'SELECT * from newtable'
      conn
        .execute(sql)
        .then(console.log)
        .finally(() => {
          conn.close()
          pool.close()
        })
    })
  })
  .catch(function (err) {
    console.log(err)
  })
